#ifndef SCREENCAPTURE_H
#define SCREENCAPTURE_H

#include <QtGlobal>
#include <QByteArray>
#include <QObject>
extern "C" {
#include <libavutil/pixfmt.h>
}


class ScreenCapture : public QObject
{
    Q_OBJECT
public:
    ScreenCapture(QObject *parent=nullptr);
//    virtual ~ScreenCapture(){}
    virtual void updateFramebuffer(){}
    virtual int getFramebufferSize(){ return -1; }
    virtual QByteArray getFramebuffer();
//    virtual void getFramebuffer(QByteArray &data);
    virtual void getFramebuffer(char* data);
    virtual AVPixelFormat pixelFormat();

    virtual int x();
    virtual int y();
    virtual int width();
    virtual int height();
    virtual int winId() = 0;

    virtual void postMouseEvent(int button, bool isPress, int x,int y);
    virtual void postKeyEvent(int key, bool isPress);
    virtual void postWheelEvent(int delta);

protected:
    int m_x;
    int m_y;
    int m_width;
    int m_height;
};
#endif // SCREENCAPTURE_H
